<%#
    # mainNav  : 主导航元素组对象
    #   *.leftList  : 主导航栏左侧导航元素
    #   *.rightList : 主导航栏右侧导航元素（登陆）
    #       *.text  : 导航标题
    #       *.link  : 导航链接
    #       *.sty   : 元素样式类
    #   *.loginFlag : 判断用户是否登陆
#%>
<nav class="main_nav text-center container-fluid">
    <div class="col-5 row clearfix">
        <ul class="left-list row float-left">
            <li>
                <a href="/">
                    <img src="/images/little_logo.png" alt="小logo图标">
                    <span>首页</span>
                </a>
            </li>
            <% mainNav.leftList.forEach(function (item) { %>
                <li>
                    <a href="<%= item.link %>" class="<%= item.sty %>"><%= item.text %></a>
                </li>
            <% }) %>
        </ul>
    </div>

    <div class="searchBarBox col-2 row">
        <form class="searchBar">
            <label>
                <input type="text" placeholder="搜索">
            </label>
            <div class="searchButtonBox">
                <button type="button" class="fa fa-search" aria-hidden="true"></button>
            </div>
        </form>
    </div>

    <div class="col-5 clearfix row">
        <ul class="right-list row float-right">
            <% if (mainNav.loginFlag) { %>
                <!--  登陆后的  -->
                <% mainNav.rightList.forEach(function (item) { %>
                    <li>
                        <a href="<%= item.link %>" class="<%= item.sty %>"><%= item.text %></a>
                    </li>
                <% }) %>
            <% } else { %>
                <!--  登陆前的  -->
                <li class="loginBox float-right">
                    <a href="/login" class="loginButton">登录</a>
                    <span> / </span>
                    <a href="/register" class="registerButton">注册</a>
                </li>
                <li>
                    <a href="/inboundNotice" class="inboundNotice">入站须知</a>
                </li>
            <% } %>
        </ul>
    </div>

</nav>